﻿@model CNFM_CROCODILE_LOGO.Core.Domain.ViewModels.SignageApplicationReview

@{
    ViewData["Title"] = "申请单复审";
}

@section Scripts
    {
    <script type="text/javascript">
        var selfLayer = null, page = 1, active = null;
        layui.use(['form', 'layedit'], function () {
            var form = layui.form; //表格


             form.on('radio(IsReview)', function (data) {
                if (data.value == 'false') {
                    $('#TwoToExamineNum').attr('disabled', 'disabled');
                    document.getElementById("TwoToExamineNum").value = "0";
                    //alert("147");
                } else {
                    $('#TwoToExamineNum').removeAttr('disabled');
                    // alert("258");
                }
            });

            //监听提交
            form.on('submit(submit)', function (data) {
                // data.field
                axios({
                    method: 'post',
                    url: '/SignageApplication/ReviewSignageApplicationTwo',
                    //headers: {
                    //    'content-type': 'application/x-www-form-urlencoded'
                    //},
                    data: data.field
                })
                    .then(function (response) {
                        console.log(response);
                        if (response.data.code == 200) {
                            javascript: history.go(-1);
                        } else {
                            alert(response.data.msg)
                        }

                    }).catch(function (error) {
                        console.log("审核失败!" + error);
                    });
                return false;
            });

        });
    </script>
}

<form class="layui-form layui-form-pane" asp-action="Edit">
    <div class="layui-form-item">
        <label class="layui-form-label">是否审批</label>
        <div class="layui-input-block">
            <input type="radio" name="IsReview" lay-filter="IsReview" value="true" title="是" checked="">
            <input type="radio" name="IsReview" lay-filter="IsReview" value="false" title="否">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">申请数量</label>
        <div class="layui-input-block">
            <input type="number" class="layui-input w_545" autocomplete="off" lay-verify="required" asp-for="ApplyNum" disabled="disabled">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">初审数量</label>
        <div class="layui-input-block">
            <input type="number" class="layui-input w_545" autocomplete="off" lay-verify="required" asp-for="OneToExamineNum" disabled="disabled">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">审批数量</label>
        <div class="layui-input-block">
            <input type="number" class="layui-input w_545" autocomplete="off" id="TwoToExamineNum"  lay-filter="TwoToExamineNum" lay-verify="required" asp-for="TwoToExamineNum">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea asp-for="Remarks" style="width:545px;height:100px"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input class="layui-btn" type="button" style="width: 100px" lay-submit lay-filter="submit" value="立即提交" />
            <button type="reset" style="width: 100px" class="layui-btn layui-btn-primary">重置</button>
            <a style="width: 100px" class="layui-btn layui-btn-primary" asp-action="ListTwo">返回</a>
        </div>
    </div>
    <input type="hidden" asp-for="Id" />
</form>

